home *** CD-ROM | disk | FTP | other *** search
- Path: news.clark.net!not-for-mail
- From: gusty@clark.net (Harlan Messinger)
- Newsgroups: comp.lang.c++
- Subject: Re: overloading []
- Date: 17 Jan 1996 21:32:22 GMT
- Organization: Clark Internet Services, Inc., Ellicott City, MD USA
- Message-ID: <4djpt6$p02@clarknet.clark.net>
- References: <4dgjbl$6i3@news1.goodnet.com> <4dh86s$bfi@locutus.rchland.ibm.com>
- NNTP-Posting-Host: explorer.clark.net
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- X-Newsreader: TIN [UNIX 1.3 950726BETA PL0]
-
- pstaite@vnet.ibm.com wrote:
- :
- : No, you could do:
- :
- : (*f)[ 1 ] = 10;
- :
- : or what I would do:
- :
- : foo& f( *new foo );
- : f[ 1 ] = 10;
- :
- : // later on:
- :
- : delete &f;
- :
-
- Why would you do
-
- foo& f(* new foo);
-
- followed by a delete instead of just
-
- foo f;
-
- with f disappearing when it goes out of scope?
-
-